Performance overview
PVAC-HFHE excels at shallow circuits and scalar operations. From benchmark data:Core operations
All benchmarks from
benchmarks/README.md running on DigitalOcean Premium AMD 8-core 2.0GHz with g++ -O3 -march=native.Key generation performance
Frombenchmarks/README.md:191-200:
Optimization tips
Mitigation strategies:- Cache keys: Generate once, serialize to disk
- Precompute powers: The
powg_Btable is the bottleneck - Parallel generation: H matrix generation can be parallelized
Encryption performance
Single value encryption
From benchmark data:- Time: 84.11ms (mean)
- Stddev: 2.08ms
- vs BFV: 8x slower
- vs CKKS: 3.6x faster
Depth hint optimization
Frominclude/pvac/ops/encrypt.hpp:732-738:
- Use depth 0 for additions only
- Use depth 1-2 for shallow multiplications
- Use depth 3+ only when necessary
Addition performance
From benchmark data:- Time: 0.012ms (12 microseconds)
- vs BFV: 10x faster
- vs CKKS: 87x faster
Why so fast?
Frominclude/pvac/ops/arithmetic.hpp:165-188, addition is pure graph concatenation:
Multiplication performance
From benchmark data:- Time: 2.47ms (mean)
- vs BFV shallow: 2.9x faster (7.23ms)
- vs BFV leveled: 7.4x faster (18.28ms)
- vs CKKS: 14.3x faster (35.23ms)
Depth performance
Frombenchmarks/README.md:88-98:
Optimization strategies
1. Minimize depth
2. Use ct_square for x²
Frominclude/pvac/ops/arithmetic.hpp:227-255:
3. Tune S parameter
The S parameter controls edges per product layer. Larger S increases time/size but improves noise distribution.
Dot product performance
Frombenchmarks/README.md:116-124:
- n encryptions of a: n × 84ms
- n encryptions of b: n × 84ms
- n multiplications: n × 2.47ms
- n additions: n × 0.012ms (negligible)
- Total: ~168n ms for PVAC vs ~2300n ms for BFV
Polynomial evaluation
For f(x) = 3x³ + 2x² + 5x + 7: Frombenchmarks/README.md:128-136:
Ciphertext size optimization
Frombenchmarks/README.md:76-86:
Compaction
Automatic edge compaction when budget exceeded:Parallel throughput
Frombenchmarks/README.md:175-181:
Comparison: PVAC vs bit-level FHE
Frombenchmarks/README.md:32-39:
benchmarks/README.md:150-160:
This comparison is for demonstration only. Bit-level FHE solves different problems (arbitrary boolean circuits) vs PVAC (arithmetic circuits).
Memory usage
Estimated memory for different operations:Benchmarking your code
Fromexamples/basic_usage.cpp:246-265:
Compiler optimization flags
Frombenchmarks/README.md:274:
-O3: Maximum optimization-march=native: CPU-specific instructions (SIMD, AES-NI)-fopenmp: Parallel support
Next steps
Depth management
Master circuit depth optimization
Arithmetic operations
Learn efficient operation patterns